/**
 * 
 */
package com.effectivsocial.core.primefaces.extension;

import java.util.Date;

import lombok.Getter;
import lombok.Setter;

import org.primefaces.extensions.model.timeline.TimelineEvent;

/**
 * @author Dhrubo
 * 
 */
public class SimpleTimelineEvent implements TimelineEvent {
	
	@Getter @Setter
	private String title;
	@Getter @Setter
	private String styleClass;
	@Getter @Setter
	private Date startDate;
	@Getter @Setter
	private Date endDate;
	@Getter @Setter
	private String id;
	@Getter @Setter
	private Object entity;

	
	
	@Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (getClass() != obj.getClass()) {
            return false;
        }

        final SimpleTimelineEvent other = (SimpleTimelineEvent) obj;
        if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
            return false;
        }

        if (this.startDate != other.startDate && (this.startDate == null || !this.startDate.equals(other.startDate))) {
            return false;
        }

        if (this.endDate != other.endDate && (this.endDate == null || !this.endDate.equals(other.endDate))) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.title != null ? this.title.hashCode() : 0);
        hash = 79 * hash + (this.startDate != null ? this.startDate.hashCode() : 0);
        hash = 79 * hash + (this.endDate != null ? this.endDate.hashCode() : 0);

        return hash;
    }

    @Override
    public String toString() {
        return "SimpleTimelineEvent{" +
                "title='" + title + '\'' +
                ", styleClass='" + styleClass + '\'' +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                '}';
    }

}
